<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="public/lib/html5shiv.js"></script>
    <script type="text/javascript" src="public/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="public/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="public/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="public/static/h-ui.admin/css/style.css" />
    <!-- <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/vendor.css" /> -->
    <link rel="stylesheet" type="text/css" href="public/static/h-ui.admin/css/style.default.min.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="public/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>调查问券</title>
</head>
<body>
<div class="page-container">
    <div class="panel panel-default">
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <form class="form form-horizontal" id="form-admin-add">
                    {foreach name="info" item="vo"}
                    {if condition="$vo.form_type eq 1"}
                        <div class="col-sm-12 col-md-12">
                            <div class="form-group">
                                <label class="control-label">{$vo.form_title}<span class="asterisk">*</span></label>
                                <input type="text" name="{$vo.form_name}" id="{$vo.form_name}" value="" class="form-control cellphone J-phone ime-mode skin-minimal">
                            </div>
                        </div>
                    {elseif condition="$vo.form_type eq 2"/}
                        <div class="col-sm-12 col-md-12">
                            <div class="form-group">
                                <label class="control-label">{$vo.form_title}<span class="asterisk">*</span></label>
                                <div class="row mt10">
                                    <div class="col-xs-3 col-sm-4 col-pad-sm">
                                        <div class="rdio rdio-default">
                                            <input class="J-listener skin-minimal" type="radio" name="{$vo.form_name}" id="{$vo.form_name}1" value="1" required="" checked>
                                            <label for="{$vo.form_name}1">&nbsp;&nbsp;是</label>
                                        </div>
                                    </div>
                                    <div class="col-xs-3 col-sm-4 col-pad-sm">
                                        <div class="rdio rdio-default">
                                            <input class="J-listener skin-minimal" type="radio" name="{$vo.form_name}" id="{$vo.form_name}2" value="2" required="">
                                            <label for="{$vo.form_name}2">&nbsp;&nbsp;否</label>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    {else /}
                    {/if}
                    {/foreach}
                    <div class="row cl">
                        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                            <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>

    </div>
</div>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="public/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="public/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="public/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="public/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="public/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="public/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="public/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="public/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="public/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="public/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript">
    $(function(){
        $('.skin-minimal input').iCheck({
            checkboxClass: 'icheckbox-blue',
            radioClass: 'iradio-blue',
            increaseArea: '20%'
        });

        $("#form-admin-add").validate({
            rules:{
    /*            form_title:{
                    required:true,
                },
                form_name:{
                    required:true,
                }*/
                /*                password2:{
                 required:true,
                 equalTo: "#password"
                 },
                 sex:{
                 required:true,
                 },
                 phone:{
                 required:true,
                 isPhone:true,
                 },
                 email:{
                 required:true,
                 email:true,
                 },
                 adminRole:{
                 required:true,
                 },*/
            },
            onkeyup:false,
            focusCleanup:true,
            success:"valid",
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type: 'post',
                    url: "{:url('questionnaire_add')}" ,
                    success: function(data){
                        layer.msg(data.msg,{icon:1,time:1000});
                        if(data.code == 1){
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.$('.btn-refresh').click();
                            parent.layer.close(index);
                        }
                    },
                    error: function(XmlHttpRequest, textStatus, errorThrown){
                        layer.msg('error!',{icon:1,time:1000});
                    }
                });

            }
        });
    });
</script>
</body>
</html>
